const location = global.location
console.log(location)
const u = navigator.userAgent
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端

export default {
  beforeRouteEnter (to, from, next) {
    console.log('[to.path]', to.path)
    console.log('[location.pathname]', location.pathname)
    if (isiOS && to.path !== location.pathname) {
      // 此处不能使用location.replace
      console.log('[to.fullPath]', to.fullPath)
      location.assign(to.fullPath)
    } else {
      next()
    }
  }
}
